//
//  ViewController.m
//  07--UIViewControllerLifeCycle
//
//  Created by 冀永金 on 16/7/22.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ViewController.h"
#import "FirstViewController.h"
@interface ViewController ()

@end

@implementation ViewController
#pragma mark -----life Cycle

- (void)loadView {
    [super loadView];
    NSLog(@" %@----%s",[self class],__FUNCTION__);
}
- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@" %@----%s",[self class],__FUNCTION__);
    self.view.backgroundColor = [UIColor cyanColor];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemPlay target:self action:@selector(handlePlay:)];
    // Do any additional setup after loading the view.
}
// 视图出现 就会调用
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    NSLog(@" %@----%s",[self class],__FUNCTION__);
  
    
}
// 视图已经出现 完全出现
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    NSLog(@" %@----%s",[self class],__FUNCTION__);
}
// 试图将要消失 就会调用  只要有一点消失
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    NSLog(@" %@----%s",[self class],__FUNCTION__);
}
// 视图已经消失   完全消失
- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
    NSLog(@" %@----%s",[self class],__FUNCTION__);
}

- (void)handlePlay:(UIBarButtonItem *)item {
    FirstViewController *first = [[FirstViewController alloc]init];
    [self.navigationController pushViewController:first animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
